package cn._51doit.live.udf;

import cn._51doit.live.pojo.DataBean;
import org.apache.flink.api.common.functions.AggregateFunction;

public class HotGoodTopNAggFunction implements AggregateFunction<DataBean, Integer, Integer> {

    @Override
    public Integer createAccumulator() {
        return 0;
    }

    @Override
    public Integer add(DataBean value, Integer accumulator) {
        return accumulator + 1;
    }

    @Override
    public Integer getResult(Integer accumulator) {
        return accumulator;
    }

    @Override
    public Integer merge(Integer a, Integer b) {
        return null;
    }
}
